package cn.huanzi.qch.baseadmin.ecco.home.service;

import cn.huanzi.qch.baseadmin.ecco.home.pojo.Note;
import cn.huanzi.qch.baseadmin.ecco.home.repository.NoteRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class NoteService {
    @Autowired
    private NoteRepository noteRepository;

    public List<Note> getNoteByFilename(String filename){

        List<Note> rs=noteRepository.findAllByFilename(filename);
        return rs;
    }


    public void add(Note note){
        note.setFeaturename("Unicode");
        note.setCreatetime(new Date());
        noteRepository.save(note);
    }

    public List<Note> findAll() {
        List<Note> rs=noteRepository.findAll();
        return rs;
    }

    public List findNum(){
        List<Note> rs=noteRepository.findSQL();
        return rs;
    }

}
